class MyClass:
    def __init__(self, name):
        self.name = name

    def __str__(self):
        return "MyClass object with name: " + self.name

    def __len__(self):
        return len(self.name)

    def __getitem__(self, index):
        return self.name[index]

    def __setitem__(self, index, value):
        self.name = self.name[:index] + value + self.name[index + 1:]


my_obj = MyClass("Hello")
print(my_obj)  # 输出：MyClass object with name: Hello
print(len(my_obj))  # 输出：5
print(my_obj[1])  # 输出：e
my_obj[1] = "a"
print(my_obj)  # 输出：MyClass object with name: Hallo
